package sim.ring.gui.actions;

import org.eclipse.jface.action.Action;
import sim.ring.gui.RingingSimApp;
import sim.ring.gui.RingingSimManager;

public class ExitAction extends Action {

	RingingSimApp r;
	
	public static String _CLOSECONFIRMDIALOGTITLE, _CLOSECONFIRMDIALOGMESSAGE;
	
	public ExitAction(RingingSimApp application) {
		r = application;
		setText(r.getLocalisedData("exitAction", "E&xit@Ctrl+Q"));
		setToolTipText(r.getLocalisedData("exitActionTooltip", "Exit the application"));
		setImageDescriptor(RingingSimManager.getIMGReg().getDescriptor("exitIcon"));
		_CLOSECONFIRMDIALOGMESSAGE = r.getLocalisedData("messageOnClose", "Save method tree data?");
		_CLOSECONFIRMDIALOGTITLE = r.getLocalisedData("messageTitleOnClose", "Confirm");
	}
	
	@Override
	public void run() {
		r.close();
	}

}
